<?php
/**
 * Created by PhpStorm.
 * User: 清行
 * Date: 2019/3/19
 * Time: 15:05
 */
namespace xiaokang;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\ErrorLogHandler;
class Log
{
    static public $logger;
    function __construct()
    {
    }

    static public function add($message)
    {
        self::$logger = new Logger('my_logger');
        self::$logger->pushHandler(new StreamHandler(LOG_PATH.'\my_app.log', Logger::INFO));
        self::$logger->pushHandler(new ErrorLogHandler(ErrorLogHandler::OPERATING_SYSTEM, Logger::ERROR, false));
        self::$logger->info($message);
    }
}